.class final Lcom/ninesky/browser/du;
.super Landroid/widget/CursorAdapter;


# instance fields
.field private a:Lcom/ninesky/browser/BookmarksActivity;

.field private b:Landroid/content/ContentResolver;

.field private c:Z


# direct methods
.method public constructor <init>(Lcom/ninesky/browser/BookmarksActivity;Landroid/database/Cursor;Z)V
    .locals 1

    const/4 v0, 0x1

    invoke-direct {p0, p1, p2, v0}, Landroid/widget/CursorAdapter;-><init>(Landroid/content/Context;Landroid/database/Cursor;Z)V

    iput-boolean p3, p0, Lcom/ninesky/browser/du;->c:Z

    iput-object p1, p0, Lcom/ninesky/browser/du;->a:Lcom/ninesky/browser/BookmarksActivity;

    invoke-virtual {p1}, Lcom/ninesky/browser/BookmarksActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iput-object v0, p0, Lcom/ninesky/browser/du;->b:Landroid/content/ContentResolver;

    return-void
.end method

.method static a(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;Z)Landroid/database/Cursor;
    .locals 9

    const/4 v5, 0x0

    const/16 v8, 0x3f

    const/4 v7, 0x1

    const/4 v6, 0x0

    if-eqz p0, :cond_0

    if-nez p2, :cond_1

    :cond_0
    move-object v0, v5

    :goto_0
    return-object v0

    :cond_1
    if-nez p1, :cond_3

    move-object v0, p2

    :goto_1
    invoke-static {v0}, Lcom/ninesky/browser/du;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {p2}, Lcom/ninesky/browser/du;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v8}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x4

    new-array v4, v4, [Ljava/lang/String;

    aput-object v0, v4, v6

    aput-object v1, v4, v7

    const/4 v0, 0x2

    aput-object v2, v4, v0

    const/4 v0, 0x3

    aput-object v3, v4, v0

    const-string v0, "url == ? OR url == ? OR url LIKE ? || \'%\' OR url LIKE ? || \'%\'"

    if-eqz p3, :cond_2

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "("

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ") AND "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "bookmark"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " == 1"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    move-object v3, v0

    :goto_2
    new-array v2, v7, [Ljava/lang/String;

    const-string v0, "_id"

    aput-object v0, v2, v6

    sget-object v1, Lcom/ninesky/browser/provider/e;->a:Landroid/net/Uri;

    move-object v0, p0

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    goto :goto_0

    :cond_2
    move-object v3, v0

    goto :goto_2

    :cond_3
    move-object v0, p1

    goto :goto_1
.end method

.method private a(II)Landroid/graphics/Bitmap;
    .locals 3

    const/4 v1, 0x0

    if-ltz p2, :cond_0

    invoke-virtual {p0}, Lcom/ninesky/browser/du;->getCount()I

    move-result v0

    if-le p2, v0, :cond_1

    :cond_0
    move-object v0, v1

    :goto_0
    return-object v0

    :cond_1
    invoke-virtual {p0, p2}, Lcom/ninesky/browser/du;->getItem(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/database/Cursor;

    invoke-interface {p0, p1}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v0

    if-nez v0, :cond_2

    move-object v0, v1

    goto :goto_0

    :cond_2
    const/4 v1, 0x0

    array-length v2, v0

    invoke-static {v0, v1, v2}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v0

    goto :goto_0
.end method

.method private static a(Ljava/lang/String;)Ljava/lang/String;
    .locals 2

    if-nez p0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    const/16 v0, 0x3f

    invoke-virtual {p0, v0}, Ljava/lang/String;->indexOf(I)I

    move-result v0

    const/4 v1, -0x1

    if-eq v0, v1, :cond_1

    const/4 v1, 0x0

    invoke-virtual {p0, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    :cond_1
    move-object v0, p0

    goto :goto_0
.end method

.method static a(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)V
    .locals 2

    new-instance v0, Lcom/ninesky/browser/q;

    invoke-direct {v0, p0, p1, p2, p3}, Lcom/ninesky/browser/q;-><init>(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)V

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/ninesky/browser/q;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    return-void
.end method

.method private b(II)Ljava/lang/String;
    .locals 1

    if-ltz p2, :cond_0

    invoke-virtual {p0}, Lcom/ninesky/browser/du;->getCount()I

    move-result v0

    if-le p2, v0, :cond_1

    :cond_0
    const-string v0, ""

    :goto_0
    return-object v0

    :cond_1
    invoke-virtual {p0, p2}, Lcom/ninesky/browser/du;->getItem(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/database/Cursor;

    invoke-interface {p0, p1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method


# virtual methods
.method public final a(I)V
    .locals 3

    if-ltz p1, :cond_0

    invoke-virtual {p0}, Lcom/ninesky/browser/du;->getCount()I

    move-result v0

    if-lt p1, v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p0, p1}, Lcom/ninesky/browser/du;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/database/Cursor;

    const/4 v1, 0x1

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x5

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    const/4 v0, 0x0

    iget-object v2, p0, Lcom/ninesky/browser/du;->b:Landroid/content/ContentResolver;

    invoke-static {v0, v2, v1}, Lcom/ninesky/browser/provider/b;->a(Landroid/content/Context;Landroid/content/ContentResolver;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public final b(I)Ljava/lang/String;
    .locals 1

    const/4 v0, 0x5

    invoke-direct {p0, v0, p1}, Lcom/ninesky/browser/du;->b(II)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final bindView(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V
    .locals 6

    const/4 v5, 0x0

    const/4 v4, 0x1

    move-object v0, p1

    check-cast v0, Lcom/ninesky/browser/view/w;

    move-object v1, v0

    const/4 v2, 0x5

    invoke-interface {p3, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/ninesky/browser/view/w;->a(Ljava/lang/String;)V

    invoke-interface {p3, v4}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/ninesky/browser/view/w;->b(Ljava/lang/String;)V

    const/4 v3, 0x6

    invoke-interface {p3, v3}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v3

    if-eqz v3, :cond_1

    array-length v2, v3

    invoke-static {v3, v5, v2}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/ninesky/browser/view/w;->a(Landroid/graphics/Bitmap;)V

    :goto_0
    iget-boolean v1, p0, Lcom/ninesky/browser/du;->c:Z

    if-eqz v1, :cond_0

    check-cast p1, Lcom/ninesky/browser/view/aa;

    const/4 v1, 0x4

    invoke-interface {p3, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    if-ne v4, v1, :cond_2

    move v1, v4

    :goto_1
    invoke-virtual {p1, v1}, Lcom/ninesky/browser/view/aa;->a(Z)V

    :cond_0
    return-void

    :cond_1
    invoke-static {}, Lcom/ninesky/browser/BookmarkHistoryActivity;->a()Lcom/ninesky/browser/az;

    move-result-object v3

    invoke-virtual {v3, v2}, Lcom/ninesky/browser/az;->a(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/ninesky/browser/view/w;->a(Landroid/graphics/Bitmap;)V

    goto :goto_0

    :cond_2
    move v1, v5

    goto :goto_1
.end method

.method public final c(I)Ljava/lang/String;
    .locals 1

    const/4 v0, 0x1

    invoke-direct {p0, v0, p1}, Lcom/ninesky/browser/du;->b(II)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final d(I)Landroid/graphics/Bitmap;
    .locals 1

    const/4 v0, 0x7

    invoke-direct {p0, v0, p1}, Lcom/ninesky/browser/du;->a(II)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method

.method public final e(I)Landroid/graphics/Bitmap;
    .locals 1

    const/4 v0, 0x6

    invoke-direct {p0, v0, p1}, Lcom/ninesky/browser/du;->a(II)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method

.method public final f(I)Landroid/graphics/Bitmap;
    .locals 1

    const/16 v0, 0x8

    invoke-direct {p0, v0, p1}, Lcom/ninesky/browser/du;->a(II)Landroid/graphics/Bitmap;

    move-result-object v0

    return-object v0
.end method

.method public final newView(Landroid/content/Context;Landroid/database/Cursor;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 2

    iget-boolean v0, p0, Lcom/ninesky/browser/du;->c:Z

    if-eqz v0, :cond_0

    new-instance v0, Lcom/ninesky/browser/view/aa;

    iget-object v1, p0, Lcom/ninesky/browser/du;->a:Lcom/ninesky/browser/BookmarksActivity;

    invoke-direct {v0, v1}, Lcom/ninesky/browser/view/aa;-><init>(Landroid/content/Context;)V

    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Lcom/ninesky/browser/view/w;

    iget-object v1, p0, Lcom/ninesky/browser/du;->a:Lcom/ninesky/browser/BookmarksActivity;

    invoke-direct {v0, v1}, Lcom/ninesky/browser/view/w;-><init>(Landroid/content/Context;)V

    goto :goto_0
.end method
